Dynomotion

Group: DynoMotion Message: 2184 From: himykabibble Date: 11/11/2011
Subject: ExecuteProg Vars
I'm not clear on how the "persist vars" are used by custom M-code programs in KMotionCNC. It clearly allows me to define a var to be "owned" by a particular M-code program, and it will be persisted across invocations, but there does not appear to be a mechanism for the value of a var to be set before the program is executed. It would be really nice if M-code programs could have arguments that could be passed into M-code programs. This would greatly expand what could be done with M-code programs. Is there such a mechanism, and I'm just not seeing it?

Regards,
Ray L.
Group: DynoMotion Message: 2186 From: Tom Kerekes Date: 11/11/2011
Subject: Re: ExecuteProg Vars
Hi Ray,
 
Yes we are lacking that type of functionality.  For Tool changes (M6) and Spindle Speed (S) the tool number or speed is set into the specified Persist Var.  For the other M Codes it really isn't of much value.  Actualy the M Code number is set into the Var which is useful to have multiple MCodes map to the same User Program and let the User program know which MCode invoked it.
 
Just haven't figured out a simple general method for passing information.
 
I'm not sure how the GCode syntax would support "parameters"
 
It wouldn't be hard to make the MCode download for example the "P" word to the specified Persist Variable.  So then:
 
M100 P1.234
 
would be possible.  Or I think I can easily tell which "words" are specified in the Block so we might have
 
M100 I1.234 J1.234 K1.234
 
download those 3 words into multiple consecutive persist Vars starting at the specified Var.
 
Regards
TK

Group: DynoMotion Message: 2187 From: himykabibble Date: 11/11/2011
Subject: Re: ExecuteProg Vars
Tom,

Your second proposal below would be great. That is essentially how Mach3 handles it, and it's very handy. For example, I can create a single probing macro as an M-macro that I can call with one argument specifying the axis to move, another the distance, another the speed. Or one that you pass a variable indicating whether to probe to find an edge, the center of a hole, or a corner, etc. Mach3 allows you to specify up to three parameters, using any of X, Y, Z, A, B, C, H or P (which ones you use is irrelevant).

Are the persist variables 100% user-managed? i.e. - I can use any ones I like, without worrying about collisions with ones that are used internally?

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>  
> Yes we are lacking that type of functionality.  For Tool changes (M6) and Spindle Speed (S) the tool number or speed is set into the specified Persist Var.  For the other M Codes it really isn't of much value.  Actualy the M Code number is set into the Var which is useful to have multiple MCodes map to the same User Program and let the User program know which MCode invoked it.
>  
> Just haven't figured out a simple general method for passing information.
>  
> I'm not sure how the GCode syntax would support "parameters"
>  
> It wouldn't be hard to make the MCode download for example the "P" word to the specified Persist Variable.  So then:
>  
> M100 P1.234
>  
> would be possible.  Or I think I can easily tell which "words" are specified in the Block so we might have
>  
> M100 I1.234 J1.234 K1.234
>  
> download those 3 words into multiple consecutive persist Vars starting at the specified Var.
>  
> Regards
> TK
>
>
> ________________________________
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 11, 2011 7:46 AM
> Subject: [DynoMotion] ExecuteProg Vars
>
>
>  
> I'm not clear on how the "persist vars" are used by custom M-code programs in KMotionCNC. It clearly allows me to define a var to be "owned" by a particular M-code program, and it will be persisted across invocations, but there does not appear to be a mechanism for the value of a var to be set before the program is executed. It would be really nice if M-code programs could have arguments that could be passed into M-code programs. This would greatly expand what could be done with M-code programs. Is there such a mechanism, and I'm just not seeing it?
>
> Regards,
> Ray L.
>